home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / Basic / Visual Basic.60 / COMMON / TOOLS / VCM / VCM.MDB / VcmComponentContainer / 06_Cabinet / EventBub.Dsr < prev    next >
Encoding:
Text File  |  1998-05-18  |  2.1 KB  |  61 lines

  1. VERSION 5.00
  2. Begin {90290CCD-F27D-11D0-8031-00C04FB6C701} EventBub 
  3.    ClientHeight    =   4770
  4.    ClientLeft      =   1815
  5.    ClientTop       =   1545
  6.    ClientWidth     =   5985
  7.    _ExtentX        =   10557
  8.    _ExtentY        =   8414
  9.    SourceFile      =   "C:\Program Files\Microsoft Visual Studio\MSDN98\98VS\1033\Samples\VB98\DHShowMe\EventBub.htm"
  10.    BuildFile       =   "c:\dhtml\EventBub.htm"
  11.    BuildMode       =   0
  12.    TypeLibCookie   =   135
  13.    AsyncLoad       =   0   'False
  14.    id              =   "DHTMLPage1"
  15.    ShowBorder      =   0   'False
  16.    ShowDetail      =   0   'False
  17.    AbsPos          =   0   'False
  18. End
  19. Attribute VB_Name = "EventBub"
  20. Attribute VB_GlobalNameSpace = False
  21. Attribute VB_Creatable = True
  22. Attribute VB_PredeclaredId = False
  23. Attribute VB_Exposed = True
  24. Private Function EventArea_onclick() As Boolean
  25. 'If bubbling is enabled and the user selects the button,
  26. 'this event procedure will  be fired after the "TheButton_onclick"
  27. 'procedure, below. The code in this procedure changes the
  28. 'background color of the entire page to "wheat."
  29.     DHTMLPage.Document.bgColor = "wheat"
  30. End Function
  31.  
  32. Private Sub HTMLPage_Load()
  33. 'On load, initialize the checked state of the radio buttons
  34. 'so that nobubble is checked first.
  35.     bubble.Checked = False
  36.     nobubble.Checked = True
  37.     
  38. End Sub
  39.  
  40. Private Function TheButton_onclick() As Boolean
  41. 'Determine whether bubbling is enabled or not. The first action
  42. 'to take is to change the color of the button itself. If bubbling
  43. 'is enabled, the event automatically bubbles up to the EventArea
  44. 'DIV. If not, the bubbling is cancelled.
  45.     If bubble.Checked = True Then
  46.         TheButton.Style.backgroundColor = "slateblue"
  47.     ElseIf nobubble.Checked = True Then
  48.         TheButton.Style.backgroundColor = "slateblue"
  49.         'Cancel bubbling:
  50.         Document.parentWindow.event.cancelBubble = True
  51.     End If
  52. End Function
  53.  
  54. Private Sub TheButton_onmouseout()
  55. 'Return the document colors to their original state on
  56. 'mouseout so that the effect can be repeated on subsequent
  57. 'clicks.
  58.     TheButton.Style.backgroundColor = "buttonface"
  59.     Document.bgColor = "white"
  60. End Sub
  61.